package com.ruoyi.veterinary.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.veterinary.mapper.VetManufacturerMapper;
import com.ruoyi.veterinary.domain.VetManufacturer;
import com.ruoyi.veterinary.service.IVetManufacturerService;

/**
 * 药品厂家Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-01-19
 */
@Service
public class VetManufacturerServiceImpl implements IVetManufacturerService 
{
    @Autowired
    private VetManufacturerMapper vetManufacturerMapper;

    /**
     * 查询药品厂家
     * 
     * @param manufacturerId 药品厂家主键
     * @return 药品厂家
     */
    @Override
    public VetManufacturer selectVetManufacturerByManufacturerId(Long manufacturerId)
    {
        return vetManufacturerMapper.selectVetManufacturerByManufacturerId(manufacturerId);
    }

    /**
     * 查询药品厂家列表
     * 
     * @param vetManufacturer 药品厂家
     * @return 药品厂家
     */
    @Override
    public List<VetManufacturer> selectVetManufacturerList(VetManufacturer vetManufacturer)
    {
        return vetManufacturerMapper.selectVetManufacturerList(vetManufacturer);
    }

    /**
     * 新增药品厂家
     * 
     * @param vetManufacturer 药品厂家
     * @return 结果
     */
    @Override
    public int insertVetManufacturer(VetManufacturer vetManufacturer)
    {
        vetManufacturer.setCreateTime(DateUtils.getNowDate());
        return vetManufacturerMapper.insertVetManufacturer(vetManufacturer);
    }

    /**
     * 修改药品厂家
     * 
     * @param vetManufacturer 药品厂家
     * @return 结果
     */
    @Override
    public int updateVetManufacturer(VetManufacturer vetManufacturer)
    {
        vetManufacturer.setUpdateTime(DateUtils.getNowDate());
        return vetManufacturerMapper.updateVetManufacturer(vetManufacturer);
    }

    /**
     * 批量删除药品厂家
     * 
     * @param manufacturerIds 需要删除的药品厂家主键
     * @return 结果
     */
    @Override
    public int deleteVetManufacturerByManufacturerIds(Long[] manufacturerIds)
    {
        return vetManufacturerMapper.deleteVetManufacturerByManufacturerIds(manufacturerIds);
    }

    /**
     * 删除药品厂家信息
     * 
     * @param manufacturerId 药品厂家主键
     * @return 结果
     */
    @Override
    public int deleteVetManufacturerByManufacturerId(Long manufacturerId)
    {
        return vetManufacturerMapper.deleteVetManufacturerByManufacturerId(manufacturerId);
    }

    /**
     * 查询所有正常状态的厂家
     * 
     * @return 厂家列表
     */
    @Override
    public List<VetManufacturer> selectActiveManufacturerList()
    {
        return vetManufacturerMapper.selectActiveManufacturerList();
    }
}